package com.wgc.goods.feign;

import com.wgc.entity.Result;
import com.wgc.goods.domain.Detail;
import com.wgc.goods.domain.ProductDetails;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("goods")
public interface DetailFeign {
    /**
     * 查询商品详情页
     */
    @GetMapping("/detail/findDetail")
    Result<Detail> findDetail(@RequestParam Long id);
    /**
     * 条件查询商品详情表
     * @param iProductDetails
     * @return
     */
    @PostMapping("/ProductDetails/selectList")
    Result<List<ProductDetails>> select(@RequestBody ProductDetails iProductDetails);

    /**
     * 减库存
     * @param productId ，num
     * @return
     */
    @GetMapping("/ProductDetails/reduceStock")
    Result reduceStock(@RequestParam Long productId,@RequestParam Integer num);

}
